<template>
  <a-space direction="vertical" :size="16" fill>
    <a-card
      class="general-card"
      title="酿酒车间品温监控表（一车间）"
      :header-style="{ paddingBottom: '12px' }"
    >
      <a-grid :cols="24" :col-gap="12" :row-gap="12">
        <a-grid-item
          :span="{ xs: 24, sm: 24, md: 24, lg: 24, xl: 24, xxl: 24 }"
        >
          <div v-for="(item, i) in groupedArray" :key="i">
            <a-breadcrumb style="margin-bottom: 16px">
              <a-breadcrumb-item>{{
                item[0].workshop_alais
              }}</a-breadcrumb-item>
              <a-breadcrumb-item>{{ item[0].group_alais }}</a-breadcrumb-item>
            </a-breadcrumb>
            <a-table
              :columns="columns"
              :data="item"
              stripe
              sticky-header
              :scroll="scroll"
              :bordered="{ wrapper: true, cell: true }"
              column-resizable
            >
              <template #email="{ record }">
                <a-button type="text" @click="addTemp(record)">新增</a-button>
                <a-button type="text" @click="editTemp(record)">编辑</a-button>
              </template>
            </a-table>
          </div>
        </a-grid-item>
      </a-grid>
    </a-card>
  </a-space>
  <!-- 编辑品温对话框 -->
  <TempModal ref="tempModal" :gettempInfo="gettempInfo" />
</template>

<script lang="ts" setup>
import ChainItem from './chain-item.vue';
import TempModal from './tempModal.vue';
import { ref } from 'vue';
const props = defineProps({
  tempInfoList: {
    type: Array,
  },
  gettempInfo: {
    type: Function,
  },
  groupedArray: {
    type: Array,
  },
});
const tempModal = ref(''); // 品温对话框
const scroll = {
  x: 2000,
  y: 500,
};
// 新增品温数据
const addTemp = (record) => {
  tempModal.value.openMoadl(record, 'add');
};
const editTemp = (record) => {
  tempModal.value.openMoadl(record, 'edit');
};
const columns = [
  {
    title: '品温名称',
    dataIndex: 'temperatrueAlais',
    fixed: 'left',
  },
  {
    title: '入缸时间',
    dataIndex: 'start_time',
    width: 120,
    minWidth: 120,
  },
  {
    title: '入温',
    dataIndex: 'enter_temp',
  },
  {
    title: '地温',
    dataIndex: 'ground_temp',
  },
  {
    title: '一对时',
    dataIndex: 'one',
  },
  {
    title: '二对时',
    dataIndex: 'two',
  },
  {
    title: '三对时',
    dataIndex: 'three',
  },
  {
    title: '四对时',
    dataIndex: 'four',
  },
  {
    title: '五对时',
    dataIndex: 'five',
  },
  {
    title: '六对时',
    dataIndex: 'six',
  },
  {
    title: '七对时',
    dataIndex: 'seven',
  },
  {
    title: '八对时',
    dataIndex: 'eight',
  },
  {
    title: '九对时',
    dataIndex: 'nine',
  },
  {
    title: '十对时',
    dataIndex: 'ten',
  },
  {
    title: '十一对时',
    dataIndex: 'eleven',
  },
  {
    title: '十二对时',
    dataIndex: 'twelve',
  },
  {
    title: '十三对时',
    dataIndex: 'thirteen',
  },
  {
    title: '十四对时',
    dataIndex: 'fourteen',
  },
  {
    title: '十五对时',
    dataIndex: 'fifteen',
  },
  { title: '操作', dataIndex: 'email', slotName: 'email' },
];
const data = [];
</script>

<style scoped lang="less"></style>
